﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlexiCommerce.Components;

namespace FlexiCommerce
{
    public class DestinationOnOrBelowItselfException : FlexiException
    {
        public DestinationOnOrBelowItselfException(HierarchicalPersistenceItem source, HierarchicalPersistenceItem destination)
            : base("Cannot move item to a destination onto or below itself.")
        {
            this.sourceItem = source;
            this.destinationItem = destination;
        }

        private HierarchicalPersistenceItem sourceItem;
        private HierarchicalPersistenceItem destinationItem;

        /// <summary>Gets the source item that is causing the conflict.</summary>
        public HierarchicalPersistenceItem SourceItem
        {
            get { return sourceItem; }
        }

        /// <summary>Gets the parent item already containing an item with the same name.</summary>
        public HierarchicalPersistenceItem DestinationItem
        {
            get { return destinationItem; }
        }

    }
}
